moddbfandomcom-20200213-history
Programming 2D scrolling games
Programming 2D scrolling games is a book writen by John "Krylar" Logsdon, for PureBasic. It is meant to be a complete introduction to game programming (and programming in general). Official Description "Programming 2D Scrolling Games" is a comprehensive guide to creating 2D scrolling games with PureBasic development language. An accompanying CD contains a demo version of PureBasic, as well as all the example programs referenced througout the book, which can be loaded directly into the PureBasic IDE, and compiled and run with ease. Aimed at beginners and advanced users alike, "Programming 2D Scrolling Games" starts with the roots of game development, and continues to explore the ins-and-outs of the PureBasic development language, and even takes you through the entire development process of a futuristic side-scroller! Complete Table of Contents # PureBasic ### Welcome to PureBasic ### What is PureBasic and who is this Book for? ### Why Learn PureBasic? ### What Will I Need to Run PureBasic? ### The Major Sections of this Book ### Conventions Used in this Book ### What's on the CD? ## Fundamentals of programming ### What is a Program? ### Object Code ### Bits and Bytes ### Screen Resolutions and Bit-Depth ### Speed Impact of Higher Resolutions and Bit-Depths ### DirectX, Peripheral Cards and Drivers ### Creative and Technical Design Documents ### Good Coding Style and Commenting ### A Place to Work ## Getting started with PureBasic ### The PureBasic IDE Main Screen ### What Every PureBasic Program Must Contain ### The PureBasic Debugger ### The Good Old "Hello, World!" Program ## The basics of PureBasic ### Variables, What are they? ### Defining Variables ### Commenting Your Code ### Simple Arithmetic ### Cartesian Coordinates ## Program Control Statements ### If... Then... Else... EndIf ### Nested IF Statements ### ElseIf Statement ### And and Or Statements ### The SELECT Statement ### Loop Basics ### For…Next Loops ### While…Wend Loops ### Repeat…Until/Forever ## Understanding/Using arrays ### What Arrays Look Like ### Initializing an Array (the DIM command) ### Multidimensional Arrays ### Re-dimensioning Arrays ### Loading Data Values into an Array ### Variable Length Data Statements ## Understanding/Using structures ### Arrays of Structures ### Arrays within Structures ### Array of Types ### Basic Structure Lists ### Advanced Structure Operations – Extending Structures ### Advanced Structure Operations – Pointers ### Other Structure Commands ## Working with memory ### Creating and Freeing Memory Buffers ### Poke and Peek ### Resizing Allocated Memory ### Copying Memory Buffers ### Comparing Memory ### String-Specific Commands ## Procedures and libraries ### Declaring a Procedure ### Passing Arguments and Returning Results ### Including Files ### Libraries ## Working with files ### Creating a File ### Writing to a File ### Reading from a File ### Moving Around Inside of Files ### A Quick Binary Example ### Miscellaneous File Commands # PB Game Tools ## Colors and drawing primitives ### Getting and Setting Colors ### Dealing with Pixels ### Drawing Lines ### Rectangles ### Circles and Ellipses ## Working with sprites ### Basic Loading and Displaying of Sprites ### Rotating an Image to Make Multiple Frames ### Grabbing Images from Memory ### Writing Directly to a Sprite ## Handling animation ### Page Flip Animation ### Animating Images ### Animation Timing ## Collision Detection ### Bounding Box Collisions ### Pixel-Perfect Collision Detection ## Handling input ### Using the Keyboard ### Using the Mouse ### Displaying a Custom Mouse Cursor ### Using the Joystick ## Sounds and music ### Loading Sounds ### Manipulating Sounds ### Multiple Sounds Playing Simultaneously ### Loading Sounds into Memory ### Overlaying Multiple Sounds ### Playing Music ### Music Modules ## Timers ### Frames per Second (FPS) Tracking ### The Rolling Timer ### Locking in at Real Time # Migz Callo: Lazer Blazer ## Game design ### Background Story ### Game Features ### Art Asset List ### Sound Asset List ### Music Asset List ### Map Asset List ### Technical List ## Z-ordering ### What is Z-Ordering? ### Why Use Z-Ordering? ### How to Implement Z-Ordering ## Loading map files ### Loading Tiles ### Text-Based Map File Format ### Loading Map Dimensions ### Loading the Map Data ### Binary-Based Map Files ### Loading Binary Maps ### Saving Binary Maps ### Showing a Loaded Map ## Moving sprites on scrolling maps ### Player hits a wall ### Screen and World Coordinates ### Scrolling a Map (Theory) ### Edge-Independent Scrolling ### Scrolling Code ### More on Coordinate Systems ### Screen Vs. World ### Robots, HealthPaks, and Lasers…oh my! ## Simple AI ### Robots Doing Stuff ### Robots Firing ### Migz Gets Bored ### Migz Falls Asleep ## Putting it all together ### The main loop ### Making a level for Migz ### Placing robots and healthpaks ### Code for starting a level ### Conclusion External Links Krylar's Kreations. Buy from share-it! Category: Books